[Unit]
Description=Zookeeper Server
After=network.target


[Service]
Type=forking
User={{ owner }}
Group={{ group }}
Restart=on-failure
RestartSec=30
Environment=ZOO_LOG_DIR={{ zookeeper_log_path }}/{{ zookeeper_link_name }}
ExecStart=/bin/bash -c "source /home/{{ owner }}/.bashrc && {{ zookeeper_install_path }}/{{ zookeeper_link_name }}/bin/zkServer.sh start"
ExecStop=/bin/bash -c "source /home/{{ owner }}/.bashrc && {{ zookeeper_install_path }}/{{ zookeeper_link_name }}/bin/zkServer.sh stop"
LimitCORE=infinity
LimitNOFILE=500000
CapabilityBoundingSet=CAP_NET_ADMIN CAP_IPC_LOCK CAP_SYS_NICE

[Install]
# Zookeeper should not start from the rescue shell (rescue.target).
WantedBy=multi-user.target
